<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <script src="./js/jquery-3.1.1.min.js"></script>
  <title>css3 动画</title>
  <style>
    body{
      margin: 0;
    }
    .nav {
      width: 507px;
      height: 300px;
      margin: 100px 0 0 278px;
      display: flex;
      justify-content: space-between;
      perspective: 1000px;/*Z轴纵深 */
      /* background-color: #ef476f; */
    }
    .tab {
      width: 200px;
      height: 300px;
      display: flex;
      flex-direction: column;
    }
    .content {
      width: 260px;
      height: 260px;
      position: relative;  /* 建立 三维坐标系*/
      top: 20px;
      left: -33px;
      transform: rotateX(-90deg);
      transform-style: preserve-3d;
      /* 3D 旋转  这一部分 默认是一个面在转 看不到其他的面*/
      transition: 0.5s ;
    }
    .tab1, .tab2, .tab3{
      width: 200px;
      height: 100px;
      color: white;
      font-weight: bold;
      text-align: center;
      line-height: 100px;
    }
    .tab1 {
      background-color: #06d6a0;
    }
    .tab2 {
      background-color: #1b9aaa;
    }
    .tab3 {
      background-color: #ef476f;
    }
    .content1, .content2, .content3{
      width: 260px;
      height: 260px;
      color: white;
      font-weight: bold;
      text-align: center;
      line-height: 260px;
      position: absolute;
    }
    .content1 {
      background-color:  #06d6a0;
      transform:translateY(-130px)  rotateX(90deg);
    }
    .content2 {
      background-color: #1b9aaa;
      transform: translateZ(130px);
    }
    .content3 {
      background-color: #ef476f;
      transform: translateY(130px) rotateX(-90deg); 
    }


  </style>
</head>
<body>
  <div class="nav">
    <div class="tab">
      <div class="tab1">TOP</div>
      <div class="tab2">FRONT</div>
      <div class="tab3">BOTTOM</div>
    </div>
    <div class="content">
      <div class="content1">TOP CONTENT</div>
      <div class="content2">FRONT CONTENT</div>
      <div class="content3">BOTTOM CONTENT</div>
    </div>
    <script> // 旋转整个 content
      $(".tab1").click(()=>{
        $('.content').css("transform","rotateX(-90deg)")
      })
      $(".tab2").click(()=>{
        $('.content').css("transform","rotateX(0)")
      })
      $(".tab3").click(()=>{
        $('.content').css("transform","rotateX(90deg)")
      })
    </script>
  </div>
</body>
</html>